package com.bm.config;



import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 * User: sx
 * Date: 2022/2/9
 * Time: 15:08
 * Description: java
 */
@Configuration
public class Neo4jConfig {
//    @Value("${neo4j.uri}")
////    private String uri;
////    @Value("${neo4j.username}")
////    private String username;
////    @Value("${neo4j.password}")
////    private String password
    @Bean(name = "driver")
    public Driver initDriver() {
        Driver driver;
        try {
            //neo4j地址 账号 密码
            driver = GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "SX19971201"));
           // driver = GraphDatabase.driver(uri, AuthTokens.basic(username, password));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return driver;
    }

}
